package practise;
/**
 * 复习深拷贝、浅拷贝*/
class Bank implements Cloneable {
    public String name;
    public String location;
    public Money money;
    public Bank(String name, String location, int money) {
        this.name = name;
        this.location = location;
        this.money = new Money();
        this.money.count = money;
    }

    @Override
    public String toString() {
        return "Bank{" +
                "name='" + name + '\'' +
                ", location='" + location + '\'' +
                ", money=" + money.count +
                '}';
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
class Money implements Cloneable{
    public int count;
    public Money() {

    }
    public Money(int money) {
        this.count = money;
    }
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
